// 该文件专门用于创建整个应用的路由器
import VueRouter from 'vue-router'
//引入组件
import About from '@/pages/About.vue'
import Home from '@/pages/Home.vue'
import News from '@/pages/News.vue'
import Details from '@/pages/Details.vue'
import ShowInfo from '@/pages/ShowInfo.vue'


export default new VueRouter({
    routes: [
        {
            //命名路由，有名字之后可通过to指定【name】的路由，不用再指定多级目录
            name: 'guanyu',
            path: '/about',
            component: About
        },
        {
            path: '/home',
            component: Home,
            children: [
                {
                    path: 'news',
                    component: News
                },
                {
                    path: 'details',
                    component: Details,
                    children: [
                        {
                            //命名路由，有名字之后可通过to指定【name】的路由，不用再指定多级目录
                            name: 'xiangqing',
                            path: 'showInfo',
                            component: ShowInfo
                        }
                    ]
                }
            ]
        },
    ]
})